﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NotAClue.ComponentModel.DataAnnotations
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    public class CascadeHierarchicalAttribute : Attribute
    {
        public String[] Parameters { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CascadeHierarchicalAttribute"/> class.
        /// </summary>
        /// <param name="parameters">
        /// The parameters are the parent columns in
        /// order of  hierarchy and must be Foreign Key
        /// navigation columns for the hierarchy for car manufacturers
        /// e.g. Manufacturer, VehicleType, Model and Style on the 
        /// Styles table the parameters would be:
        /// [CascadeHierarchical("Manufacturer", "VehicleType", "Model")]
        /// as Style would already be known via foreign key navigation.
        /// </param>
        public CascadeHierarchicalAttribute(params String[] parameters)
        {
            Parameters = parameters;
        }
    }
}